Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VUU-31 Layout Server POC #39

Conversation

vferraro-scottlogic
Copy link

No description provided.

pling-scottlogic and others added 30 commits August 25, 2023 12:26
- Temporary change to fix build until screenshot functionality is implemented
vferraro-scottlogic and others added 19 commits September 5, 2023 09:17
…1-save-layout-screenshot

VUU21: Implement the screenshot functionality into the Save Layout component
…7-dialogStyling

VUU17: Save Layout Panel component styling
leftSidePanelLayout="full-height"
leftSidePanel={<LeftNav style={{ width: 240 }} />}
loginUrl={window.location.toString()}
user={user}
saveLocation="local"
saveUrl="http://127.0.0.1:3000/api/vui/layouts"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to be a little careful with the ShowCase examples. Bear in mind that these are published to CloudFlare pages, where we won't have any server running. It's fine to have stories that require a server - we have plenty that require Vuu. BUT we must handle the scenario where the server isn't available and show an error message.
Also , keep one version of the NewTheme app as a purely standalone example. Ideally, we can have a single example, which can be extended with a second example which provides a saveUrl, so that example would work with the remote REST service

Copy link

@cfisher-scottlogic cfisher-scottlogic Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your point, but I'm unclear on the best way to go about doing this.

I don't think we should be passing the save location as a prop to the Shell, it feels like something which should sit in an environment/configuration file and pulled from there - with a default location already defined (such as local storage or our server implementation). Does CloudFlare serve local storage? In which case a local storage default would cover the scenario of a server being unavailable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, now I'm looking at Peter's PR (#40) and thinking about the problem again, I imagine an implementation which covers these comments will be handled by the interface?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right Cara: the saveLocation should be with the LayoutPersistenceManager

@cfisher-scottlogic cfisher-scottlogic linked an issue Sep 13, 2023 that may be closed by this pull request
Copy link

@cfisher-scottlogic cfisher-scottlogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something obvious but how do we run the server? Would it be worth adding this info to some docs?

Or at least, adding this doc-update requirement to the relevant non-spike ticket.

Comment on lines +10 to +21
router.get("/", (_, res: Response<Layout[]>) => {
res.json(layouts);
});

router.get("/:user/latest", (req: Request, res: Response<Layout | string>) => {
const layout = layouts.find((layout) => layout.metadata.user === req.params.user);
if (!layout) {
res.status(404).send("Layout not found");
} else {
res.send(layout);
}
});
Copy link

@cfisher-scottlogic cfisher-scottlogic Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to get some kind of contract defined for the layout API. Not as part of this spike but to be captured in a ticket. Particularly as Chris(?) was interested in understanding this server implementation more.

Comment on lines +15 to +17
// mount the LayoutManagement API routes
app.use('/api/vui/layouts', layoutManagementRoutes);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not majorly important but I think I would rename this file to express-app.tsand use it purely as base configuration for the express app as you've done here. Then I would move this route-specific configuration to /routes/index.ts. Does that make sense?

What would your thoughts be on that?

@pling-scottlogic pling-scottlogic force-pushed the feature/layout-management/layout-management-feature branch from 737bed8 to 28180cd Compare September 13, 2023 14:00
@cfisher-scottlogic cfisher-scottlogic deleted the VUU-31-node-server-POC branch October 16, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node.js Server POC
4 participants